<!DOCTYPE HTML>
<!-- use thinkphp:layout to output pages -->
<!-- <no_layout name="Layout\layout" />  -->
<div id="main-collect-page">
<style type="text/css">
.label{
	margin:0 1% 0 1%;
}

</style>
<!-- display right answer & explain-->

<volist name=":(array_keys($collects))" id="vo">


	
	<div class="grid_3 grid_5 widget-shadow card pressthis">
	<form action="">
		<h3 class="hdg" >{$vo}<span class="nav-badge-btm pull-right" style="right:5%;position:relative;">{:count($collects[$vo])}</span></h3>	
	
		<h3>
		<volist name="collects[$vo]" id="vp">
			<switch name="vp[right_lab]" >
				<case value="1" break="1"><a href="#"><span class="label label-success" id="{$vp.itemid}">{$vp.itemid}</span></a></case>
				<case value="0"><a href="#"><span class="label label-danger" id="{$vp.itemid}">{$vp.itemid}</span></a></case>
				<default /><a href="#"><span class="label label-info">{$vp.itemid}</span></a>
			</switch>
		</volist>
		</h3>
	</form>		
	</div>	
	
</volist>	
	
	
	
	<div id="myLoading"></div>
	
	
<!-- display right answer & explain end-->

<!-- Classie -->
		<script src="__PUBLIC__/js/classie.js"></script>
		<script>		
			function getUrlParam (name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
				var r = window.location.search.substr(1).match(reg);
				if (r != null) return unescape(r[2]); return null;
			}
			if(id = getUrlParam('itemid')){			
				$("html,body").animate({scrollTop:$("#"+id).offset().top-$("#main-collect-page").offset().top},500);	
				//$.scrollTo('#'+id,1500); 				
			}
			$(".label").click(function(event){				
				//$("#myLoading").show();				
				var ajaxData ={};
				ajaxData['itemid'] = $(this).attr("id");
				ajaxData["action"] = '{$Think.ACTION_NAME}';				
				ajaxData['__hash__'] = $('[name=__hash__]').attr('content');		
				//ajaxData['__hash__'] = document.getElementsByName("__hash__")[0].content;		
				$.post("{:U('Collect/reView')}",
					ajaxData,
					function(data,status){
					// alert("Data: " + data + "\nStatus: " + status);
						$("#main-collect-page").html(data);
				});
				//$("html").text(jsApiParameters);
				//window.location.reload();		
			});
			
		</script>
</div>